using System;
using WindowsGame.Common.Interfaces;
using Microsoft.Xna.Framework;

namespace WindowsGame.Common.Managers
{
	public interface IInputManager
	{
		void Initialize();
		void Update(GameTime gameTime);

		Boolean Escape();
		Boolean Start();
		Boolean Reset();

		void SetMotors(Single leftMotor, Single rightMotor);
		void ResetMotors();
	}

	public class InputManager : IInputManager
	{
		private readonly IInputFactory inputFactory;

		public InputManager(IInputFactory inputFactory)
		{
			this.inputFactory = inputFactory;
		}
		public void Initialize()
		{
			inputFactory.Initialize();
		}

		public void Update(GameTime gameTime)
		{
			inputFactory.Update(gameTime);
		}

		public Boolean Escape()
		{
			return inputFactory.Escape();
		}
		public Boolean Start()
		{
			return inputFactory.Start();
		}
		public Boolean Reset()
		{
			return inputFactory.Reset();
		}

		public void SetMotors(Single leftMotor, Single rightMotor)
		{
			inputFactory.SetMotors(leftMotor, rightMotor);
		}
		public void ResetMotors()
		{
			inputFactory.ResetMotors();
		}

	}
}